﻿
@{
    Layout = null;
}
<!DOCTYPE HTML>
<html lang="zh-lang">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="" content="yes" />
    <meta name="" content="black" />
    <link href="~/Content/css/tokenmall/css/styles.css" rel="stylesheet" />
    <link href="~/Content/css/tokenmall/css/special.css" rel="stylesheet" />
    <link href="~/Content/css/tokenmall/css/reg.css" rel="stylesheet" />
    <script src="~/Scripts/tokenmall/jquery-1.8.3.min.js"></script>
    <script src="~/Scripts/tokenmall/all.js?v=001"></script>
    <link href="~/Scripts/mescroll/mescroll.min.css" rel="stylesheet" />
    <script src="~/Scripts/mescroll/mescroll.min.js"></script>
    <title>我的好友</title>
</head>
<body class="page-reg page-inviteList">
    <div class="mescroll"  id="mescroll">
        <div class="con">
            <ul id="datalist"></ul>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            var mescroll = new MeScroll("mescroll", {
                down: {
                    auto: false,
                    callback: function (mescroll) {
                        mescroll.resetUpScroll(); //下拉刷新的回调,默认重置上拉加载列表为第一页
                    }
                },
                up: {
                    callback: getListData,
                    clearEmptyId: "datalist",
                    isBounce: false,
                    noMoreSize: 3,
                    htmlNodata: '<p class="upwarp-nodata">--没有更多数据了 --</p >',
                    empty: {
                        warpId: "datalist",
                        icon: "",
                        tip: "亲,没有您要找的好友~"

                    },
                    toTop: {
                        src: "/Content/css/tokenmall/img/toup.png",
                        html: " <img src='/Content/css/tokenmall/img/toup.png' />",
                        offset: 500
                    }
                }
            });

            function getListData(page) {
                $.ajax({
                    type: 'post',
                    url: '/User/_InviteList',
                    data: { page: page.num, size: page.size },
                    success: function (response) {
                        var paged = $(response).siblings("page");
                        var rows = Number.parseInt(paged.attr("rows"));
                        var total = Number.parseInt(paged.attr("total_result"));
                        mescroll.endBySize(rows, total);
                        if (paged.length === 1) {
                            $("#datalist").append($(response));
                            $('#datalist page').remove();
                        }

                    },
                    error: function (e) {
                        //联网失败的回调,隐藏下拉刷新和上拉加载的状态
                        mescroll.endErr();
                    }
                });
            }
        });

    </script>
</body>
</html>
